#include <stdio.h>
#include <unistd.h>



//
//int main()
//{
//    char *const argv[] = {"ls", NULL};
//    char * const envp[] = {"PATH=/bin:/usr/bin", NULL};
//    printf("Entering main ...\n");
//    int ret;
//    ret = execle("/bin/ls", "ls", "-l", NULL, envp);
//    if(ret == -1) {
//        perror("execl error");
//    }
//    printf("Exiting main ...\n");
//    return 0;
//}
//






//
#include <stdlib.h>
// 
//int main()
//{
//  char *const argv[] = {"ls","-l", NULL};
//    //char * const envp[] = {"PATH=/bin:/usr/bin", NULL};
//    printf("Entering main ...\n");
//    int ret;
//    //ret =execl("./hello", "hello", NULL);
//    ret =execl("/usr/bin/ls", "ls","-l", NULL);
//    if(ret == -1)
//        perror("execl error");
//    printf("Exiting main ...\n");
//    return 0;
//}
//


extern char **environ;
int main()
{
  const char* const argv[]={"ls","-l",NULL};
 const char* const envp[]={"PATH=/usr/bin",NULL};
  //execl("/usr/bin/ls","ls","-a","-l", NULL);
 // execlp("ls","ls","-a","-l",NULL);
  //execle("/bin/ls","ls","-a","-l", NULL,envp);
  //execv("/bin/ls",argv); 
  //execvp("/bin/ls",argv);
 //execve("/bin/ls",argv,envp); 
 return 0;
}


//
//int main()
//{
//  printf("before: I am a process,pid:%d,ppid:%d\n",getpid(),getppid());
//  execl("/usr/bin/ls","ls","-a","-l",NULL);
//
//  printf("after: I am a process,pid:%d,ppid:%d\n",getpid(),getppid());
//  return 0;
//}
